Skip to content

Use verify_transaction_inclusion_v2 with coinbase merkle proof#32

Merged
olga24912 merged 23 commits into
omni-mainfrom
tx64
Jun 10, 2026
Merged

Use verify_transaction_inclusion_v2 with coinbase merkle proof#32
olga24912 merged 23 commits into
omni-mainfrom
tx64

Conversation

@olga24912

Copy link
Copy Markdown

Replace verify_transaction_inclusion with verify_transaction_inclusion_v2 across all bridge verification flows (deposit, withdraw, active UTXO management)

See Near-One/btc-light-client-contract#139

Comment thread contracts/satoshi-bridge/src/btc_light_client/deposit.rs Outdated
Comment thread contracts/satoshi-bridge/src/btc_light_client/mod.rs Outdated
Comment thread contracts/satoshi-bridge/src/btc_light_client/mod.rs Outdated
Comment thread contracts/satoshi-bridge/src/api/bridge.rs
Comment thread Cargo.lock
Comment thread contracts/satoshi-bridge/src/refund.rs
Comment thread contracts/satoshi-bridge/src/btc_light_client/mod.rs

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Satoshi Bridge’s Bitcoin transaction verification flows to support verify_transaction_inclusion_v2, which includes coinbase merkle proof data for stronger inclusion verification. It introduces a shared TxInclusionProof input shape and wires it through deposit/withdraw/active-UTXO-management/refund verification paths, along with test and mock light-client updates.

Changes:

  • Add TxInclusionProof and new *_v2 bridge entrypoints that accept a nested proof object including coinbase proof fields.
  • Update the bridge’s BTC light client integration to call verify_transaction_inclusion_v2 when coinbase proof is provided, falling back to v1 otherwise.
  • Extend workspace tests and the mock BTC light client contract to exercise/enable the v2 verification path.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
contracts/satoshi-bridge/src/lib.rs Introduces TxInclusionProof used by v2 APIs.
contracts/satoshi-bridge/src/btc_light_client/mod.rs Adds v2 proof args + external interface and routes calls to v2 when coinbase proof exists.
contracts/satoshi-bridge/src/api/bridge.rs Adds verify_deposit_v2, safe_verify_deposit_v2, verify_withdraw_v2, verify_active_utxo_management_v2; refactors legacy methods and updates refund finalize signature.
contracts/satoshi-bridge/src/btc_light_client/deposit.rs Refactors deposit verification into reusable entry helpers; plumbs optional coinbase proof through verification.
contracts/satoshi-bridge/src/btc_light_client/withdraw.rs Adds an internal “entry” helper to reuse logic and support v2 coinbase proof.
contracts/satoshi-bridge/src/btc_light_client/active_utxo_management.rs Adds an internal “entry” helper and keeps active UTXO management verification compatible with v2 proofs.
contracts/satoshi-bridge/src/refund.rs Switches refund verification to use TxInclusionProof and v2 inclusion verification; uses Base64VecU8 for tx bytes.
contracts/satoshi-bridge/tests/setup/context.rs Adds v2 test helpers and updates refund helper argument shape to include nested proof.
contracts/satoshi-bridge/tests/test_satoshi_bridge.rs Adds tests covering v2 deposit/safe-deposit/withdraw and a (currently non-asserting) v2 active UTXO management test.
contracts/mock-btc-light-client/src/lib.rs Adds mock implementation for verify_transaction_inclusion_v2.
contracts/satoshi-bridge/release_notes.md Notes the v2 inclusion verification addition for version 0.9.0.
contracts/satoshi-bridge/Cargo.toml Bumps satoshi-bridge version to 0.9.0.
contracts/mock-btc-light-client/Cargo.toml Bumps mock-btc-light-client version to 0.2.0.
Cargo.lock Updates locked versions for the bumped crates.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread contracts/satoshi-bridge/tests/test_satoshi_bridge.rs Outdated
Comment thread contracts/satoshi-bridge/src/api/bridge.rs
Comment thread contracts/satoshi-bridge/src/api/bridge.rs
Comment thread contracts/satoshi-bridge/src/btc_light_client/deposit.rs Outdated
Comment thread contracts/satoshi-bridge/tests/setup/context.rs Outdated
Comment thread contracts/satoshi-bridge/src/api/bridge.rs
@olga24912 olga24912 merged commit c8c8464 into omni-main Jun 10, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants